//2009/08/16 01:17:35
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class ArrayHash
{
public:
    int getHash(vector <string> input)
    {
		int total = 0;
		for(int i=0; i<input.size(); i++)
		{
			for(int j=0; j<input[i].size(); j++)
			{
				total += input[i][j] - 'A' + i + j;
			}
		}
		return total;
    }
};
